/*ConsoleUser  后台管理用户*/
import request from "/@/utils/request";
import download from "/@/utils/download.ts";

const ConsoleUserApi = {

    getPageData(data: any) {
        return request({
            url: "/companyAccount/pageData",
            method: "post",
            data,
        });
    },
    getDetail(data: any) {
        return request({
            url: "/companyAccount/getDetail",
            method: "post",
            data,
        });
    },

    save: (data: any) => {
        return request({
            url: "/companyAccount/save",
            method: "post",
            data,
        });
    },
    addUser: (data: any) => {
        return request({
            url: "/companyAccount/add",
            method: "post",
            data,
        });
    },

    editUser: (data: any) => {
        return request({
            url: "/companyAccount/edit",
            method: "post",
            data,
        });
    },
    assignRole: (data: any) => {
        return request({
            url: "/companyAccount/assignRole",
            method: "post",
            data,
        });
    },

    del: (data: any) => {
        return request({
            url: "/companyAccount/delete",
            method: "post",
            data,
        });
    },


    resetPassword: (data: any) => {
        return request({
            url: "/companyAccount/resetPassword",
            method: "post",
            data,
        });
    },

    updateStatus: (data: any) => {
        return request({
            url: "/companyAccount/updateStatus",
            method: "post",
            data,
        });
    },
    pageDataXls:(_searchParam: any,_xlsTitle: any,fileName?:string) => {
        return request({
            url: "/companyAccount/pageDataXls",
            method: "post",
            responseType: 'blob',
            data: {
                _searchParam,_xlsTitle
            },
        }).then((res)=> {
            download(res)
        });
    },
};
export default ConsoleUserApi;
